﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Simple.Repository.Models.Attendance
{
    public class StaffAttendanceCycle : BusinessFullEntityBase<Guid>
    {

        /// <summary>
        /// 工作日名称
        /// </summary>
        public string Name { get; set; } = "";

        /// <summary>
        /// 考勤日(PeriodType)
        /// </summary>
        public int PeriodType { get; set; }

        /// <summary>
        /// 员工规则Id
        /// </summary>
        public Guid? StaffAttendanceRuleId { get; set; } = null;

        /// <summary>
        /// 班级动态信息
        /// </summary>
        public StaffAttendanceRule StaffAttendanceRule = new StaffAttendanceRule();

        public override void ConfigureEntity(ModelBuilder builder)
        {
            builder.Entity<StaffAttendanceCycle>(entity =>
            {
                entity.ToTable("Staff_Attendance_CycleSetting");
                entity.HasOne(c => c.StaffAttendanceRule).WithMany(c => c.CycleSettings).HasForeignKey(c => c.StaffAttendanceRuleId);
            });
        }

    }
}
